﻿using System;
using System.Collections.Generic;

namespace AccelerateSensor.Model.Node
{
    /// <summary>
    /// 节点数据
    /// </summary>
    public class NodeData
    {
        /// <summary>
        /// 节点编号
        /// </summary>
        public string NodeUuid { get; set; }

        /// <summary>
        /// 采集类型，0：加速度波形；1：加速度均值，2：倾角 3：速度波
        /// </summary>
        public int AcquireDataType { get; set; }

        /// <summary>
        /// 数据通道个数
        /// </summary>
        public int ChanNum { get; set; }

        /// <summary>
        /// 采样率
        /// </summary>
        public int SampleRate { get; set; }

        /// <summary>
        /// 数据通道名称
        /// </summary>
        public string[] Names { get; set; }

        /// <summary>
        /// 数据
        /// </summary>
        public List<float[]> ValueList { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }

        /// <summary>
        /// 入库时间
        /// </summary>
        public DateTime LocalUpdateTime { get; set; }

        public string NamesString => string.Join(" ", Names);

        public void UpdateData(NodeData data)
        {
            AcquireDataType = data.AcquireDataType;
            ChanNum = data.ChanNum;
            SampleRate = data.SampleRate;
            Names = data.Names;
            ValueList = data.ValueList;
            UpdateTime = data.UpdateTime;
        }
    }
}
